perm filename CYCDRJ[1,LMM] blob sn#034856 filedate 1973-04-12 generic text, type T, neo UTF8
(DE ISOMERS ()
(PROG(CL U)
CLLP (PRINT @CL?)
 (SETQ CL (READ))
 (COND((ATOM CL) (PRINC @"THAT CAN'T BE RIGHT - ENTER A ")(GO CLLP)))
 (COND((FOR NEW PR IN CL OR 
     (OR (ATOM PR)
	 (NOT (NUMBERP (CDR PR)))
	 (NOT (ATOM (CAR PR)))
         (NOT (OR (NUMBERP (GET (CAR PR)(QUOTE VALENCE)))
		  (PROG2 (TERPRI)
			 (PRINC @ "WHAT'S THE VALENCE OF ")
			 (PRINC (CAR PR))
			 (PRINC @?)
			 (NUMBERP (PUTPROP (CAR PR) (READ)@VALENCE)))))))
        (GO CLLP)))
ULP (PRINT @U?)
    (COND((NOT(NUMBERP(SETQ U (READ))))(GO ULP)))
    (SETQ RESULTS (MOLECULES CL U))
   (PRINT (LIST (LENGTH RESULTS) @STRUCTURES @GENERATED)))))))))))))))


(DE RING ()
(PROG(CL U)
CLLP (PRINT @CL?)
 (SETQ CL (READ))
 (COND((ATOM CL) (PRINC @"THAT CAN'T BE RIGHT - ENTER A ")(GO CLLP)))
 (COND((FOR NEW PR IN CL OR 
     (OR (ATOM PR)
	 (NOT (NUMBERP (CDR PR)))
	 (NOT (ATOM (CAR PR)))
         (NOT (OR (NUMBERP (GET (CAR PR)(QUOTE VALENCE)))
		  (PROG2 (TERPRI)
			 (PRINC @ "WHAT'S THE VALENCE OF ")
			 (PRINC (CAR PR))
			 (PRINC @?)
			 (NUMBERP (PUTPROP (CAR PR) (READ)@VALENCE)))))))
        (GO CLLP)))
ULP (PRINT @U?)
    (COND((NOT(NUMBERP(SETQ U (READ))))(GO ULP)))
    (SETQ RESULTS (RINGS U CL))
   (PRINT (LIST (LENGTH RESULTS) @STRUCTURES @GENERATED)))))))))))))))


(DE DRAW (N)
(PROG(S)
 (COND((GREATERP N (LENGTH RESULTS))
	(PRINT @(NOT THAT MANY STRUCTURES -- TRY AGAIN!!!)))
     ((STRUCTURE?(SETQ S (CAR (NTH RESULTS N))))
		(DRAWS S NIL))
    (T(SETQ TITLE (LIST @STRUCTURE# N))(PRINRAD S)))))))))))


(DE LABELLER()
(PROG(CL U)
CLLP (TERPRI)(PRINC @"ATOMS TO BE LABELLED?")
 (SETQ CL (READ))
 (COND((ATOM CL) (PRINC @"THAT CAN'T BE RIGHT - ENTER A ")(GO CLLP)))
 (COND((FOR NEW PR IN CL OR 
     (OR (ATOM PR)
	 (NOT (NUMBERP (CDR PR)))
	 (NOT (ATOM (CAR PR)))
         (NOT (OR (NUMBERP (GET (CAR PR)(QUOTE VALENCE)))
		  (PROG2 (TERPRI)
			 (PRINC @ "WHAT'S THE VALENCE OF ")
			 (PRINC (CAR PR))
			 (PRINC @?)
			 (NUMBERP (PUTPROP (CAR PR) (READ)@VALENCE)))))))
        (GO CLLP)))
ULP (PRINT @U?)
    (COND((NOT(NUMBERP(SETQ U (READ))))(GO ULP)))
    (SETQ RESULTS (MOLECULES CL U))
   (PRINT (LIST (LENGTH RESULTS) @STRUCTURES @GENERATED)))))))))))))))